package com.app.fenak;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.Toast;

public class AddContactActivity extends Activity {

	private ImageButton searchBtn;
	private EditText searchQuery;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		
		
		super.onCreate(savedInstanceState);
		setContentView(R.layout.add_new_contact);
		
		searchBtn = (ImageButton) findViewById(R.id.search_btn);
		searchQuery = (EditText) findViewById(R.id.contact_name);
		
		searchBtn.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				String str = searchQuery.getText().toString();
				if(str.length() > 0) {
					
					AddContactActivity.this.findViewById(R.id.progress_bar).setVisibility(View.VISIBLE);
					// search on server then fill ListView and show it
				} else {
					Toast.makeText(AddContactActivity.this, "Please, enter contact name", Toast.LENGTH_SHORT).show();
				}
			}
		});
		
	}
}
